home *** CD-ROM | disk | FTP | other *** search
/ Webshot XL / WEBSHOP_XL.ISO / WebShop XL / data1.cab / Library_Files / Library / Wizard_Library / DupScript.boo next >
Text File  |  2001-09-05  |  2KB  |  63 lines

  1. // DupScript.boo, for wizard
  2.  
  3. SiteManager = getMainSiteManager();
  4.  
  5. RootFolder = getMainSiteManager().getPhysicalLayout().getRootFolder();
  6.  
  7. RootFolder.wzDeleteGarbagePages();
  8.  
  9. for i = 0 to RootFolder.getResourceNumber() - 1 do
  10. {
  11.   Resource = RootFolder.getResource(i);
  12.  
  13.   if (Resource <> NULL) then
  14.     if((typeof(Resource) = "DFrameSetResource") or 
  15.        (typeof(Resource) = "DPageResource")) then
  16.     {
  17.       Index = Resource.wzGetThemePageIndex();
  18.     
  19.       if(Index <> -1) then
  20.       {
  21.         Counter = Resource.wzGetCount();
  22.         
  23.         Resource.wzAdjustPage(Index, 1, 1, 1, 1);
  24.         
  25.         if(Counter > 1) then
  26.         {
  27.           Page = Resource.getPage();
  28.         
  29.           if(Page <> NULL) then
  30.           {
  31.             LeftPage = Page;
  32.             for j = 1 to Counter - 1 do
  33.             {
  34.               ParentPage = Page.getParent(); 
  35.               DupPage = Page.duplicatePage(ParentPage, LeftPage);         
  36.               LeftPage = DupPage;
  37.             }
  38.           }
  39.           else
  40.           {
  41.             Source = Resource.getSource(0);
  42.             if(Source <> NULL) then
  43.             {
  44.               LeftSource = Source;
  45.               for k = 1 to Counter - 1 do
  46.               {
  47.                 Frame = Source.getParent();
  48.                 DupSource = Source.duplicateSource(Frame, LeftSource);              
  49.                 LeftSource = DupSource;
  50.               }  
  51.             }
  52.           }
  53.           
  54.           Resource.renameResourceEx(Resource.getNameEx() + "1");
  55.           Resource.renameResourceBase(Resource.getBaseName() + "1");
  56.         }
  57.       }  
  58.     }
  59. }
  60.  
  61.  
  62.  
  63.